package com.cb.generator.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * @author cb
 * @version 1.0
 * @date 2020/6/22 15:40
 */
public class ExcelListener extends AnalysisEventListener<DemoData> {

    /**
     * 一行一行读取excel内容
     */
    @Override
    public void invoke(DemoData demoData, AnalysisContext analysisContext) {
        System.out.println("***"+demoData);
    }

    /**
     * 获取表头的信息
     */
    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头 : "+headMap);
//        super.invokeHeadMap(headMap, context);
    }

    /**
     * 读取完成之后做什么事
     */
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }
}
